home *** CD-ROM | disk | FTP | other *** search
- Path: ix.netcom.com!news
- From: Bradd W. Szonye <bradds@ix.netcom.com>
- Newsgroups: comp.lang.c++
- Subject: RE: Special sort algorithm
- Date: 19 Apr 1996 09:28:01 GMT
- Organization: Netcom
- Message-ID: <01bb2dd2.cb714200$c6c2b7c7@Zany.localhost>
- References: <31593E09.29A0@kmd.dk> <4jciq9$1d0@news.microsoft.com>
- NNTP-Posting-Host: det-mi6-06.ix.netcom.com
- X-NETCOM-Date: Fri Apr 19 4:28:01 AM CDT 1996
- X-Newsreader: Microsoft Internet News
-
-
- On Wednesday, March 27, 1996, Dann Corbit wrote...
- > In article <31593E09.29A0@kmd.dk>, cab@kmd.dk says...
- > >
- > >Hi
- > >
- > >This is not strictly related to C++, but I guess some of you may have a
- hint
- > >on this anyway.
- > >
- > >I am trying to make a DOS file sorting program, which is to be part of
- a commercial product.
- > >It must :
- > > - Sort big files of short lines
- > > lines are uneven length
- > > files are XX MB
- > > lines are < 100 chars
- > > - Put resulting file in original file
- > > - Run in very little memory ( < 50 K)
- > > - Use about no extra disk space ( < 10% extra)
- > > - Run reasonably fast
- > >
- > >I have tried implementing in-file bubblesort and others with the
- language
- > >being C++. But they are way too slow, even with some optimizing
- buffers.
- > >
- > Order of preference:
- > counting sort, singleton's sort (ACM 347), heapsort.
- > definitely not bubblesort. It is one of the worst.
- >
- > You will have to run a merge phase, since your in-memory requirements
- > are so small.
-
- If you want a good introduction to external sorting, pick up Robert
- Sedgewick's "Algorithms," "Algorithms in C," or "Algorithms in C++,"
- according to your preference.
-
- If you want the definitive collection of searching and sorting methods,
- try to find Don Knuth's "Art of Computer Programming, Volume III:
- Searching and Sorting."
-
- Both are expensive, and Knuth is difficult to read. But they're great
- resources.
-
-
-